home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 19 / Amiga Plus Leser CD 19.iso / Tools / MorphOS / cvs-1.11.2 / source / amiga / netinclude / ppcinline / bsdsocket.h
Encoding:
C/C++ Source or Header  |  2002-11-18  |  20.6 KB  |  462 lines

  1. #ifndef _PPCINLINE_BSDSOCKET_H
  2. #define _PPCINLINE_BSDSOCKET_H
  3.  
  4. #ifndef __PPCINLINE_MACROS_H
  5. #include <ppcinline/macros.h>
  6. #endif
  7.  
  8. #ifndef BSDSOCKET_BASE_NAME
  9. #define BSDSOCKET_BASE_NAME SocketBase
  10. #endif
  11.  
  12. #define socket(domain, type, protocol) \
  13.     LP3(0x1e, LONG, socket, LONG, domain, d0, LONG, type, d1, LONG, protocol, d2, \
  14.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  15.  
  16. #define bind(sock, name, namelen) \
  17.     LP3(0x24, LONG, bind, LONG, sock, d0, struct sockaddr *, name, a0, LONG, namelen, d1, \
  18.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  19.  
  20. #define listen(sock, backlog) \
  21.     LP2(0x2a, LONG, listen, LONG, sock, d0, LONG, backlog, d1, \
  22.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  23.  
  24. #define accept(sock, addr, addrlen) \
  25.     LP3(0x30, LONG, accept, LONG, sock, d0, struct sockaddr *, addr, a0, LONG *, addrlen, a1, \
  26.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  27.  
  28. #define connect(sock, name, namelen) \
  29.     LP3(0x36, LONG, connect, LONG, sock, d0, struct sockaddr *, name, a0, LONG, namelen, d1, \
  30.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  31.  
  32. #define sendto(sock, buf, len, flags, to, tolen) \
  33.     LP6(0x3c, LONG, sendto, LONG, sock, d0, APTR, buf, a0, LONG, len, d1, LONG, flags, d2, struct sockaddr *, to, a1, LONG, tolen, d3, \
  34.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  35.  
  36. #define send(sock, buf, len, flags) \
  37.     LP4(0x42, LONG, send, LONG, sock, d0, APTR, buf, a0, LONG, len, d1, LONG, flags, d2, \
  38.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  39.  
  40. #define recvfrom(sock, buf, len, flags, addr, addrlen) \
  41.     LP6(0x48, LONG, recvfrom, LONG, sock, d0, APTR, buf, a0, LONG, len, d1, LONG, flags, d2, struct sockaddr *, addr, a1, LONG *, addrlen, a2, \
  42.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  43.  
  44. #define recv(sock, buf, len, flags) \
  45.     LP4(0x4e, LONG, recv, LONG, sock, d0, APTR, buf, a0, LONG, len, d1, LONG, flags, d2, \
  46.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  47.  
  48. #define shutdown(sock, how) \
  49.     LP2(0x54, LONG, shutdown, LONG, sock, d0, LONG, how, d1, \
  50.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  51.  
  52. #define setsockopt(sock, level, optname, optval, optlen) \
  53.     LP5(0x5a, LONG, setsockopt, LONG, sock, d0, LONG, level, d1, LONG, optname, d2, APTR, optval, a0, LONG, optlen, d3, \
  54.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  55.  
  56. #define getsockopt(sock, level, optname, optval, optlen) \
  57.     LP5(0x60, LONG, getsockopt, LONG, sock, d0, LONG, level, d1, LONG, optname, d2, APTR, optval, a0, LONG *, optlen, a1, \
  58.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  59.  
  60. #define getsockname(sock, name, namelen) \
  61.     LP3(0x66, LONG, getsockname, LONG, sock, d0, struct sockaddr *, name, a0, LONG *, namelen, a1, \
  62.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  63.  
  64. #define getpeername(sock, name, namelen) \
  65.     LP3(0x6c, LONG, getpeername, LONG, sock, d0, struct sockaddr *, name, a0, LONG *, namelen, a1, \
  66.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  67.  
  68. #define IoctlSocket(sock, req, argp) \
  69.     LP3(0x72, LONG, IoctlSocket, LONG, sock, d0, ULONG, req, d1, APTR, argp, a0, \
  70.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  71.  
  72. #define CloseSocket(sock) \
  73.     LP1(0x78, LONG, CloseSocket, LONG, sock, d0, \
  74.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  75.  
  76. #define WaitSelect(nfds, read_fds, write_fds, except_fds, timeout, signals) \
  77.     LP6(0x7e, LONG, WaitSelect, LONG, nfds, d0, APTR, read_fds, a0, APTR, write_fds, a1, APTR, except_fds, a2, struct timeval *, timeout, a3, ULONG *, signals, d1, \
  78.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  79.  
  80. #define SetSocketSignals(int_mask, io_mask, urgent_mask) \
  81.     LP3NR(0x84, SetSocketSignals, ULONG, int_mask, d0, ULONG, io_mask, d1, ULONG, urgent_mask, d2, \
  82.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  83.  
  84. #define getdtablesize() \
  85.     LP0(0x8a, LONG, getdtablesize, \
  86.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  87.  
  88. #define ObtainSocket(id, domain, type, protocol) \
  89.     LP4(0x90, LONG, ObtainSocket, LONG, id, d0, LONG, domain, d1, LONG, type, d2, LONG, protocol, d3, \
  90.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  91.  
  92. #define ReleaseSocket(sock, id) \
  93.     LP2(0x96, LONG, ReleaseSocket, LONG, sock, d0, LONG, id, d1, \
  94.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  95.  
  96. #define ReleaseCopyOfSocket(sock, id) \
  97.     LP2(0x9c, LONG, ReleaseCopyOfSocket, LONG, sock, d0, LONG, id, d1, \
  98.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  99.  
  100. #define Errno() \
  101.     LP0(0xa2, LONG, Errno, \
  102.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  103.  
  104. #define SetErrnoPtr(errno_ptr, size) \
  105.     LP2NR(0xa8, SetErrnoPtr, APTR, errno_ptr, a0, LONG, size, d0, \
  106.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  107.  
  108. #define Inet_NtoA(ip) \
  109.     LP1(0xae, STRPTR, Inet_NtoA, ULONG, ip, d0, \
  110.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  111.  
  112. #define inet_addr(cp) \
  113.     LP1(0xb4, ULONG, inet_addr, STRPTR, cp, a0, \
  114.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  115.  
  116. #define Inet_LnaOf(in) \
  117.     LP1(0xba, ULONG, Inet_LnaOf, ULONG, in, d0, \
  118.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  119.  
  120. #define Inet_NetOf(in) \
  121.     LP1(0xc0, ULONG, Inet_NetOf, ULONG, in, d0, \
  122.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  123.  
  124. #define Inet_MakeAddr(net, host) \
  125.     LP2(0xc6, ULONG, Inet_MakeAddr, ULONG, net, d0, ULONG, host, d1, \
  126.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  127.  
  128. #define inet_network(cp) \
  129.     LP1(0xcc, ULONG, inet_network, STRPTR, cp, a0, \
  130.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  131.  
  132. #define gethostbyname(name) \
  133.     LP1(0xd2, struct hostent *, gethostbyname, STRPTR, name, a0, \
  134.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  135.  
  136. #define gethostbyaddr(addr, len, type) \
  137.     LP3(0xd8, struct hostent *, gethostbyaddr, STRPTR, addr, a0, LONG, len, d0, LONG, type, d1, \
  138.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  139.  
  140. #define getnetbyname(name) \
  141.     LP1(0xde, struct netent *, getnetbyname, STRPTR, name, a0, \
  142.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  143.  
  144. #define getnetbyaddr(net, type) \
  145.     LP2(0xe4, struct netent *, getnetbyaddr, ULONG, net, d0, LONG, type, d1, \
  146.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  147.  
  148. #define getservbyname(name, proto) \
  149.     LP2(0xea, struct servent *, getservbyname, STRPTR, name, a0, STRPTR, proto, a1, \
  150.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  151.  
  152. #define getservbyport(port, proto) \
  153.     LP2(0xf0, struct servent *, getservbyport, LONG, port, d0, STRPTR, proto, a0, \
  154.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  155.  
  156. #define getprotobyname(name) \
  157.     LP1(0xf6, struct protoent *, getprotobyname, STRPTR, name, a0, \
  158.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  159.  
  160. #define getprotobynumber(proto) \
  161.     LP1(0xfc, struct protoent *, getprotobynumber, LONG, proto, d0, \
  162.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  163.  
  164. #define vsyslog(pri, msg, args) \
  165.     LP3NR(0x102, vsyslog, LONG, pri, d0, STRPTR, msg, a0, APTR, args, a1, \
  166.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  167.  
  168. #ifndef NO_PPCINLINE_STDARG
  169. #define syslog(pri, msg, tags...) \
  170.     ({ULONG _tags[] = {tags}; vsyslog((pri), (msg), (APTR) _tags);})
  171. #endif
  172.  
  173. #define Dup2Socket(old_socket, new_socket) \
  174.     LP2(0x108, LONG, Dup2Socket, LONG, old_socket, d0, LONG, new_socket, d1, \
  175.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  176.  
  177. #define sendmsg(sock, msg, flags) \
  178.     LP3(0x10e, LONG, sendmsg, LONG, sock, d0, struct msghdr *, msg, a0, LONG, flags, d1, \
  179.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  180.  
  181. #define recvmsg(sock, msg, flags) \
  182.     LP3(0x114, LONG, recvmsg, LONG, sock, d0, struct msghdr *, msg, a0, LONG, flags, d1, \
  183.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  184.  
  185. #define gethostname(name, namelen) \
  186.     LP2(0x11a, LONG, gethostname, STRPTR, name, a0, LONG, namelen, d0, \
  187.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  188.  
  189. #define gethostid() \
  190.     LP0(0x120, ULONG, gethostid, \
  191.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  192.  
  193. #define SocketBaseTagList(tags) \
  194.     LP1(0x126, LONG, SocketBaseTagList, struct TagItem *, tags, a0, \
  195.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  196.  
  197. #ifndef NO_PPCINLINE_STDARG
  198. #define SocketBaseTags(tags...) \
  199.     ({ULONG _tags[] = {tags}; SocketBaseTagList((struct TagItem *) _tags);})
  200. #endif
  201.  
  202. #define GetSocketEvents(event_ptr) \
  203.     LP1(0x12c, LONG, GetSocketEvents, ULONG *, event_ptr, a0, \
  204.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  205.  
  206. #define bpf_open(channel) \
  207.     LP1(0x16e, LONG, bpf_open, LONG, channel, d0, \
  208.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  209.  
  210. #define bpf_close(channel) \
  211.     LP1(0x174, LONG, bpf_close, LONG, channel, d0, \
  212.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  213.  
  214. #define bpf_read(channel, buffer, len) \
  215.     LP3(0x17a, LONG, bpf_read, LONG, channel, d0, APTR, buffer, a0, LONG, len, d1, \
  216.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  217.  
  218. #define bpf_write(channel, buffer, len) \
  219.     LP3(0x180, LONG, bpf_write, LONG, channel, d0, APTR, buffer, a0, LONG, len, d1, \
  220.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  221.  
  222. #define bpf_set_notify_mask(channel, signal_mask) \
  223.     LP2(0x186, LONG, bpf_set_notify_mask, LONG, channel, d1, ULONG, signal_mask, d0, \
  224.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  225.  
  226. #define bpf_set_interrupt_mask(channel, signal_mask) \
  227.     LP2(0x18c, LONG, bpf_set_interrupt_mask, LONG, channel, d0, ULONG, signal_mask, d1, \
  228.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  229.  
  230. #define bpf_ioctl(channel, command, buffer) \
  231.     LP3(0x192, LONG, bpf_ioctl, LONG, channel, d0, ULONG, command, d1, APTR, buffer, a0, \
  232.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  233.  
  234. #define bpf_data_waiting(channel) \
  235.     LP1(0x198, LONG, bpf_data_waiting, LONG, channel, d0, \
  236.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  237.  
  238. #define AddRouteTagList(tags) \
  239.     LP1(0x19e, LONG, AddRouteTagList, struct TagItem *, tags, a0, \
  240.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  241.  
  242. #ifndef NO_PPCINLINE_STDARG
  243. #define AddRouteTags(tags...) \
  244.     ({ULONG _tags[] = {tags}; AddRouteTagList((struct TagItem *) _tags);})
  245. #endif
  246.  
  247. #define DeleteRouteTagList(tags) \
  248.     LP1(0x1a4, LONG, DeleteRouteTagList, struct TagItem *, tags, a0, \
  249.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  250.  
  251. #ifndef NO_PPCINLINE_STDARG
  252. #define DeleteRouteTags(tags...) \
  253.     ({ULONG _tags[] = {tags}; DeleteRouteTagList((struct TagItem *) _tags);})
  254. #endif
  255.  
  256. #define FreeRouteInfo(buf) \
  257.     LP1NR(0x1b0, FreeRouteInfo, struct rt_msghdr *, buf, a0, \
  258.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  259.  
  260. #define GetRouteInfo(address_family, flags) \
  261.     LP2(0x1b6, struct rt_msghdr *, GetRouteInfo, LONG, address_family, d0, LONG, flags, d1, \
  262.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  263.  
  264. #define AddInterfaceTagList(interface_name, device_name, unit, tags) \
  265.     LP4(0x1bc, LONG, AddInterfaceTagList, STRPTR, interface_name, a0, STRPTR, device_name, a1, LONG, unit, d0, struct TagItem *, tags, a2, \
  266.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  267.  
  268. #ifndef NO_PPCINLINE_STDARG
  269. #define AddInterfaceTags(interface_name, device_name, unit, tags...) \
  270.     ({ULONG _tags[] = {tags}; AddInterfaceTagList((interface_name), (device_name), (unit), (struct TagItem *) _tags);})
  271. #endif
  272.  
  273. #define ConfigureInterfaceTagList(interface_name, tags) \
  274.     LP2(0x1c2, LONG, ConfigureInterfaceTagList, STRPTR, interface_name, a0, struct TagItem *, tags, a1, \
  275.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  276.  
  277. #ifndef NO_PPCINLINE_STDARG
  278. #define ConfigureInterfaceTags(interface_name, tags...) \
  279.     ({ULONG _tags[] = {tags}; ConfigureInterfaceTagList((interface_name), (struct TagItem *) _tags);})
  280. #endif
  281.  
  282. #define ReleaseInterfaceList(list) \
  283.     LP1NR(0x1c8, ReleaseInterfaceList, struct List *, list, a0, \
  284.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  285.  
  286. #define ObtainInterfaceList() \
  287.     LP0(0x1ce, struct List *, ObtainInterfaceList, \
  288.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  289.  
  290. #define QueryInterfaceTagList(interface_name, tags) \
  291.     LP2(0x1d4, LONG, QueryInterfaceTagList, STRPTR, interface_name, a0, struct TagItem *, tags, a1, \
  292.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  293.  
  294. #ifndef NO_PPCINLINE_STDARG
  295. #define QueryInterfaceTags(interface_name, tags...) \
  296.     ({ULONG _tags[] = {tags}; QueryInterfaceTagList((interface_name), (struct TagItem *) _tags);})
  297. #endif
  298.  
  299. #define CreateAddrAllocMessageA(version, protocol, interface_name, result_ptr, tags) \
  300.     LP5(0x1da, LONG, CreateAddrAllocMessageA, LONG, version, d0, LONG, protocol, d1, STRPTR, interface_name, a0, struct AddressAllocationMessage **, result_ptr, a1, struct TagItem *, tags, a2, \
  301.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  302.  
  303. #ifndef NO_PPCINLINE_STDARG
  304. #define CreateAddrAllocMessage(version, protocol, interface_name, result_ptr, tags...) \
  305.     ({ULONG _tags[] = {tags}; CreateAddrAllocMessageA((version), (protocol), (interface_name), (result_ptr), (struct TagItem *) _tags);})
  306. #endif
  307.  
  308. #define DeleteAddrAllocMessage(aam) \
  309.     LP1NR(0x1e0, DeleteAddrAllocMessage, struct AddressAllocationMessage *, aam, a0, \
  310.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  311.  
  312. #define BeginInterfaceConfig(message) \
  313.     LP1NR(0x1e6, BeginInterfaceConfig, struct AddressAllocationMessage *, message, a0, \
  314.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  315.  
  316. #define AbortInterfaceConfig(message) \
  317.     LP1NR(0x1ec, AbortInterfaceConfig, struct AddressAllocationMessage *, message, a0, \
  318.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  319.  
  320. #define AddNetMonitorHookTagList(type, hook, tags) \
  321.     LP3(0x1f2, LONG, AddNetMonitorHookTagList, LONG, type, d0, struct Hook *, hook, a0, struct TagItem *, tags, a1, \
  322.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  323.  
  324. #ifndef NO_PPCINLINE_STDARG
  325. #define AddNetMonitorHookTags(type, hook, tags...) \
  326.     ({ULONG _tags[] = {tags}; AddNetMonitorHookTagList((type), (hook), (struct TagItem *) _tags);})
  327. #endif
  328.  
  329. #define RemoveNetMonitorHook(hook) \
  330.     LP1NR(0x1f8, RemoveNetMonitorHook, struct Hook *, hook, a0, \
  331.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  332.  
  333. #define GetNetworkStatistics(type, version, destination, size) \
  334.     LP4(0x1fe, LONG, GetNetworkStatistics, LONG, type, d0, LONG, version, d1, APTR, destination, a0, LONG, size, d2, \
  335.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  336.  
  337. #define AddDomainNameServer(address) \
  338.     LP1(0x204, LONG, AddDomainNameServer, STRPTR, address, a0, \
  339.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  340.  
  341. #define RemoveDomainNameServer(address) \
  342.     LP1(0x20a, LONG, RemoveDomainNameServer, STRPTR, address, a0, \
  343.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  344.  
  345. #define ReleaseDomainNameServerList(list) \
  346.     LP1NR(0x210, ReleaseDomainNameServerList, struct List *, list, a0, \
  347.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  348.  
  349. #define ObtainDomainNameServerList() \
  350.     LP0(0x216, struct List *, ObtainDomainNameServerList, \
  351.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  352.  
  353. #define setnetent(stay_open) \
  354.     LP1NR(0x21c, setnetent, LONG, stay_open, d0, \
  355.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  356.  
  357. #define endnetent() \
  358.     LP0NR(0x222, endnetent, \
  359.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  360.  
  361. #define getnetent() \
  362.     LP0(0x228, struct netent *, getnetent, \
  363.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  364.  
  365. #define setprotoent(stay_open) \
  366.     LP1NR(0x22e, setprotoent, LONG, stay_open, d0, \
  367.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  368.  
  369. #define endprotoent() \
  370.     LP0NR(0x234, endprotoent, \
  371.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  372.  
  373. #define getprotoent() \
  374.     LP0(0x23a, struct protoent *, getprotoent, \
  375.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  376.  
  377. #define setservent(stay_open) \
  378.     LP1NR(0x240, setservent, LONG, stay_open, d0, \
  379.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  380.  
  381. #define endservent() \
  382.     LP0NR(0x246, endservent, \
  383.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  384.  
  385. #define getservent() \
  386.     LP0(0x24c, struct servent *, getservent, \
  387.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  388.  
  389. #define inet_aton(cp, addr) \
  390.     LP2(0x252, LONG, inet_aton, STRPTR, cp, a0, struct in_addr *, addr, a1, \
  391.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  392.  
  393. #define inet_ntop(af, src, dst, size) \
  394.     LP4(0x258, STRPTR, inet_ntop, LONG, af, d0, APTR, src, a0, STRPTR, dst, a1, LONG, size, d1, \
  395.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  396.  
  397. #define inet_pton(af, src, dst) \
  398.     LP3(0x25e, LONG, inet_pton, LONG, af, d0, STRPTR, src, a0, APTR, dst, a1, \
  399.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  400.  
  401. #define In_LocalAddr(address) \
  402.     LP1(0x264, LONG, In_LocalAddr, ULONG, address, d0, \
  403.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  404.  
  405. #define In_CanForward(address) \
  406.     LP1(0x26a, LONG, In_CanForward, ULONG, address, d0, \
  407.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  408.  
  409. #define mbuf_copym(m, off, len) \
  410.     LP3(0x270, struct mbuf *, mbuf_copym, struct mbuf *, m, a0, LONG, off, d0, LONG, len, d1, \
  411.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  412.  
  413. #define mbuf_copyback(m, off, len, cp) \
  414.     LP4(0x276, LONG, mbuf_copyback, struct mbuf *, m, a0, LONG, off, d0, LONG, len, d1, APTR, cp, a1, \
  415.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  416.  
  417. #define mbuf_copydata(m, off, len, cp) \
  418.     LP4(0x27c, LONG, mbuf_copydata, struct mbuf *, m, a0, LONG, off, d0, LONG, len, d1, APTR, cp, a1, \
  419.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  420.  
  421. #define mbuf_free(m) \
  422.     LP1(0x282, struct mbuf *, mbuf_free, struct mbuf *, m, a0, \
  423.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  424.  
  425. #define mbuf_freem(m) \
  426.     LP1NR(0x288, mbuf_freem, struct mbuf *, m, a0, \
  427.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  428.  
  429. #define mbuf_get() \
  430.     LP0(0x28e, struct mbuf *, mbuf_get, \
  431.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  432.  
  433. #define mbuf_gethdr() \
  434.     LP0(0x294, struct mbuf *, mbuf_gethdr, \
  435.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  436.  
  437. #define mbuf_prepend(m, len) \
  438.     LP2(0x29a, struct mbuf *, mbuf_prepend, struct mbuf *, m, a0, LONG, len, d0, \
  439.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  440.  
  441. #define mbuf_cat(m, n) \
  442.     LP2(0x2a0, LONG, mbuf_cat, struct mbuf *, m, a0, struct mbuf *, n, a1, \
  443.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  444.  
  445. #define mbuf_adj(mp, req_len) \
  446.     LP2(0x2a6, LONG, mbuf_adj, struct mbuf *, mp, a0, LONG, req_len, d0, \
  447.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  448.  
  449. #define mbuf_pullup(m, len) \
  450.     LP2(0x2ac, struct mbuf *, mbuf_pullup, struct mbuf *, m, a0, LONG, len, d0, \
  451.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  452.  
  453. #define ProcessIsServer(pr) \
  454.     LP1(0x2b2, BOOL, ProcessIsServer, struct Process *, pr, a0, \
  455.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  456.  
  457. #define ObtainServerSocket() \
  458.     LP0(0x2b8, LONG, ObtainServerSocket, \
  459.     , BSDSOCKET_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0)
  460.  
  461. #endif /*  _PPCINLINE_BSDSOCKET_H  */
  462.